#pragma once
#include <QtNetwork>
#include <QObject>
#include <QString>
#include <QTcpSocket>
#include <QHostAddress>
#include <QLabel>
#include <QStatusBar>

class Client: public QObject
{
Q_OBJECT
public:
  Client(QObject* parent = 0);
  ~Client();
  void start(QString address, quint16 port);
  void SetImageData(QByteArray* pba_);
  void setLabel(QLabel* label);
  void setStatusBar(QStatusBar* StatusBar);
public slots:
  void startTransfer();
  void startRead();
  void timeIsOver();
  void connected();
  void disConnected();
private:
  QTcpSocket client;
  QByteArray* pba;
  QLabel* pLabel;
  QStatusBar* pStatusBar;
  QTimer *tmr;
  bool StartRead;
  QByteArray bufferAll;
  QPixmap NewPixMap;
};
